home *** CD-ROM | disk | FTP | other *** search
- package java.awt.image;
-
- import java.util.Hashtable;
-
- public class ImageFilter implements ImageConsumer, Cloneable {
- protected ImageConsumer consumer;
-
- public Object clone() {
- try {
- return super.clone();
- } catch (CloneNotSupportedException var1) {
- throw new InternalError();
- }
- }
-
- public ImageFilter getFilterInstance(ImageConsumer ic) {
- ImageFilter instance = (ImageFilter)this.clone();
- instance.consumer = ic;
- return instance;
- }
-
- public void imageComplete(int status) {
- this.consumer.imageComplete(status);
- }
-
- public void resendTopDownLeftRight(ImageProducer ip) {
- ip.requestTopDownLeftRightResend(this);
- }
-
- public void setColorModel(ColorModel model) {
- this.consumer.setColorModel(model);
- }
-
- public void setDimensions(int width, int height) {
- this.consumer.setDimensions(width, height);
- }
-
- public void setHints(int hints) {
- this.consumer.setHints(hints);
- }
-
- public void setPixels(int x, int y, int w, int h, ColorModel model, byte[] pixels, int off, int scansize) {
- this.consumer.setPixels(x, y, w, h, model, pixels, off, scansize);
- }
-
- public void setPixels(int x, int y, int w, int h, ColorModel model, int[] pixels, int off, int scansize) {
- this.consumer.setPixels(x, y, w, h, model, pixels, off, scansize);
- }
-
- public void setProperties(Hashtable props) {
- props = (Hashtable)props.clone();
- Object o = props.get("filters");
- if (o == null) {
- props.put("filters", this.toString());
- } else if (o instanceof String) {
- props.put("filters", (String)o + this.toString());
- }
-
- this.consumer.setProperties(props);
- }
- }
-